var i = require("../../../../../../common/vendor.js"), t = require("../z-paging-utils.js"), o = require("../z-paging-enum.js"), e = {
    props: {
        autoHideLoadingAfterFirstLoaded: {
            type: Boolean,
            default: t.u.gc("autoHideLoadingAfterFirstLoaded", !0)
        },
        loadingFullFixed: {
            type: Boolean,
            default: t.u.gc("loadingFullFixed", !1)
        },
        autoShowSystemLoading: {
            type: Boolean,
            default: t.u.gc("autoShowSystemLoading", !1)
        },
        systemLoadingMask: {
            type: Boolean,
            default: t.u.gc("systemLoadingMask", !0)
        },
        systemLoadingText: {
            type: [ String, Object ],
            default: t.u.gc("systemLoadingText", null)
        }
    },
    data: function() {
        return {
            loading: !1,
            loadingForNow: !1
        };
    },
    watch: {
        loadingStatus: function(i) {
            var t = this;
            this.$emit("loadingStatusChange", i), this.$nextTick(function() {
                t.loadingStatusAfterRender = i;
            });
        },
        loading: function(i) {
            i && (this.loadingForNow = i);
        }
    },
    computed: {
        showLoading: function() {
            return !(this.firstPageLoaded || !this.loading || !this.loadingForNow || (this.finalShowSystemLoading && i.index.showLoading({
                title: this.finalSystemLoadingText,
                mask: this.systemLoadingMask
            }), this.autoHideLoadingAfterFirstLoaded ? !this.fromEmptyViewReload && this.pagingLoaded : this.loadingType !== o.Enum.LoadingType.Refresher));
        },
        finalShowSystemLoading: function() {
            return this.autoShowSystemLoading && this.loadingType === o.Enum.LoadingType.Refresher;
        }
    },
    methods: {
        _startLoading: function() {
            var i = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
            (this.showLoadingMoreWhenReload && !this.isUserPullDown || !i) && (this.loadingStatus = o.Enum.More.Loading), 
            this.loading = !0;
        },
        _endSystemLoadingAndRefresh: function() {
            this.finalShowSystemLoading && i.index.hideLoading(), !this.useCustomRefresher && i.index.stopPullDownRefresh();
        }
    }
};

exports.loadingModule = e;